As a conventional technology, Japanese Patent Application Laid-Open Publication No. 6-14209 (Patent Document 1) discloses a circuit for generating a ramp waveform by switching the charge/discharge current flowing in an integration capacitor. FIG. 12 shows a conventional circuit example described in Patent Document 1. In this figure, the terminal voltage of an integration capacitor 101 is applied to two voltage comparison circuits 102 and 103 having threshold voltages VL104 and VH105, a flip-flop 106 is set and reset by the outputs of the voltage comparison circuits, and a switching signal is outputted by a current switching circuit 107. The current switching circuit 107 is configured of a current mirror unit including a diode D11 and a transistor Q11, a constant current source I11, and switching transistors Q12 and Q13. The charge current and the discharge current repeatedly flow to the integration capacitor 101 by the switching of the charge/discharge current, thereby generating a ramp waveform.